package game.adm.controller;
import java.util.List;

import game.adm.dao.dto.BetTypeDTO;
import game.adm.entity.BetTypeEntityManager;
import game.adm.struts.form.BetTypeForm;
import game.web.base.Constants;
import game.web.base.StringUtils;
import projectx.core.base.ProjectXSystemException;
import projectx.core.base.ProjectXUserException;
import projectx.transaction.TransactionHandler;
import projectx.web.base.ProjectXDbTrxController;
import projectx.web.base.ProjectXForm;
import projectx.web.base.UserContext;

public class BetTypeController extends ProjectXDbTrxController {

	protected BetTypeController(UserContext uc, ProjectXForm form) {
		super(uc, form);
	}

	public Object execute() throws ProjectXUserException,
			ProjectXSystemException {
		debugBegin();

		UserContext uc = getUc();
		BetTypeForm form = (BetTypeForm)getForm();
		String operator = form.getOperator();
		String updateip = StringUtils.getString(uc.get(Constants.ADM_REQUEST_IP));
		
		if("1".equals(operator)){    //查询所有的下注类型
			List<BetTypeDTO> betTypeList = BetTypeEntityManager.listAll();
			uc.put(Constants.ADM_BETTYPE_LIST, betTypeList);
		}else if("2".equals(operator)){     //更新下注类型
			
		}

		debugEnd();
		return null;
	}

	public static Object execute(UserContext uc, ProjectXForm form)
			throws ProjectXUserException, ProjectXSystemException {
		return TransactionHandler.call(new BetTypeController(uc, form));
	}
}
